home *** CD-ROM | disk | FTP | other *** search
/ APDL Eductation Resources / APDL Eductation Resources.iso / programs / astronomy / skyview / !SkyView / h / radec < prev    next >
Encoding:
Text File  |  1992-10-14  |  7.6 KB  |  175 lines

  1. /********************************************************/
  2. /*                         radec.h                      */
  3. /*  Header file for utility functions which are useful  */
  4. /*           for objects with known RA and Dec.         */
  5. /********************************************************/
  6.  
  7. /* Length of string needed to hold RA and Dec in text   */
  8. /* form (see radec_text below):                         */
  9. #define RADEC_TEXTLEN 31
  10.  
  11. /*--------------------- radec_sethoriz -------------------
  12.  * Description: Sets altitude which object must exceed
  13.  *              in order to be regarded as visible.
  14.  *
  15.  * Parameters:  REAL altitude -- altitude in radians.
  16.  * Returns:     void.
  17.  * Other info:  Call before the first call to radec_phenomena.
  18.  *              Do not call in mid calculation.
  19.  */
  20.  
  21.   void radec_sethoriz(REAL altitude);
  22.  
  23.  
  24. /*---------------------- radec_altaz ---------------------
  25.  * Description: Converts from Right Ascension and Dec-
  26.  *              lination to Altitude and Azimuth.
  27.  *
  28.  * Parameters:  REAL ra  -- right ascension.
  29.  *              REAL dec -- declination.
  30.  *              observerstr *ob_ptr -- pointer to observerstr containing
  31.  *                                     details of location.
  32.  *              REAL sid      -- local siderial time at time and
  33.  *                               location required.
  34.  *              REAL *altptr  -- pointer to REAL to fill
  35.  *                               in with altitude.
  36.  *              REAL *azimptr -- pointer to REAL to fill
  37.  *                               in with azimuth.
  38.  * Returns:     void.
  39.  * Other info:  All angles in radians.
  40.  *              The following fields of the observerstr must be valid:
  41.  *              latit.
  42.  */
  43.  
  44. void radec_altaz(REAL ra, REAL dec, observerstr *ob_ptr, REAL sid,
  45.                  REAL *altptr, REAL *azimptr);
  46.  
  47.  
  48. /*--------------------- radec_phenomena ------------------
  49.  * Description: Determines whether object rises, sets or
  50.  *              culminates on the current day.
  51.  *
  52.  * Parameters:  REAL ra  -- right ascension.
  53.  *              REAL dec -- declination.
  54.  *              observerstr *ob_ptr -- pointer to observerstr containing
  55.  *                                     details of location.
  56.  *              double *chp -- pointer to double to fill
  57.  *                             in with cosine of hour
  58.  *                             angle at horizon.
  59.  *              BOOL *riset_ptr -- filled in with TRUE if object
  60.  *                                 rises and sets, FALSE otherwise.
  61.  *              BOOL *cul_ptr   -- filled in with TRUE if object
  62.  *                                 culminates, FALSE otherwise.
  63.  * Returns:     void.
  64.  * Other info:  All angles in radians.
  65.  *              *chp is an intermediate result needed by rise_details
  66.  *              and set_details.  It is only valid if *riset_ptr is TRUE.
  67.  *              The following fields of the observerstr must be valid:
  68.  *              latit.
  69.  */
  70.  
  71. void radec_phenomena(REAL ra, REAL dec, observerstr *ob_ptr,
  72.                      double *chp, BOOL *riset_ptr, BOOL *cul_ptr);
  73.  
  74.  
  75. /*------------------- radec_cul_details ------------------
  76.  * Description: Determines details of culmination.
  77.  *
  78.  * Parameters:  REAL ra  -- right ascension.
  79.  *              REAL dec -- declination.
  80.  *              observerstr *ob_ptr -- pointer to observerstr containing
  81.  *                                     details of location and the relation-
  82.  *                                     ship between civil and local siderial
  83.  *                                     time.
  84.  *              REAL *al -- pointer to REAL to fill in with
  85.  *                          altitude of culmination.
  86.  *              REAL *az -- pointer to REAL to fill in with
  87.  *                          azimuth of culmination.
  88.  *              int *hourptr -- pointer to int to fill in with
  89.  *                              hour of culmination.
  90.  *              int *minptr  -- pointer to int to fill in with
  91.  *                              minute of culmination.
  92.  * Returns:     void.
  93.  * Other info:  All angles in radians.
  94.  *              Routine assumes that object does indeed culminate.
  95.  *              The latit field of the observerstr must be valid, and
  96.  *              the sid field must correspond with the hour & min fields.
  97.  */
  98.  
  99. void radec_cul_details(REAL ra, REAL dec, observerstr *ob_ptr,
  100.                        REAL *al, REAL *az, int *hourptr, int *minptr);
  101.  
  102.  
  103. /*------------------- radec_rise_details ------------------
  104.  * Description: Determines details of rising.
  105.  *
  106.  * Parameters:  REAL ra   -- right ascension.
  107.  *              REAL dec  -- declination.
  108.  *              observerstr *ob_ptr -- pointer to observerstr containing
  109.  *                                     details of location and the relation-
  110.  *                                     ship between civil and local siderial
  111.  *                                     time.
  112.  *              double ch -- cosine of hour angle when object is
  113.  *                           at horizon.
  114.  *              REAL *az  -- pointer to REAL to fill in with
  115.  *                           azimuth of rising.
  116.  *              int *hourptr -- pointer to int to fill in with
  117.  *                              hour of rising.
  118.  *              int *minptr  -- pointer to int to fill in with
  119.  *                              minute of rising.
  120.  * Returns:     void.
  121.  * Other info:  All angles in radians.
  122.  *              Routine assumes that object does indeed rise.
  123.  *              The latit field of the observerstr must be valid, and
  124.  *              the sid field must correspond with the hour & min fields.
  125.  */
  126.  
  127. void radec_rise_details(REAL ra, REAL dec, observerstr *ob_ptr,
  128.                         double ch, REAL *az, int *hourptr, int *minptr);
  129.  
  130.  
  131. /*------------------- radec_set_details ------------------
  132.  * Description: Determines details of setting.
  133.  *
  134.  * Parameters:  REAL ra   -- right ascension.
  135.  *              REAL dec  -- declination.
  136.  *              observerstr *ob_ptr -- pointer to observerstr containing
  137.  *                                     details of location and the relation-
  138.  *                                     ship between civil and local siderial
  139.  *                                     time.
  140.  *              double ch -- cosine of hour angle when object is
  141.  *                           at horizon.
  142.  *              REAL *az  -- pointer to REAL to fill in with
  143.  *                           azimuth of setting.
  144.  *              int *hourptr -- pointer to int to fill in with
  145.  *                              hour of setting.
  146.  *              int *minptr  -- pointer to int to fill in with
  147.  *                              minute of setting.
  148.  * Returns:     void.
  149.  * Other info:  All angles in radians.
  150.  *              Routine assumes that object does indeed set.
  151.  *              The latit field of the observerstr must be valid, and
  152.  *              the sid field must correspond with the hour & min fields.
  153.  */
  154.  
  155. void radec_set_details(REAL ra, REAL dec, observerstr *ob_ptr,
  156.                        double ch, REAL *az, int *hourptr, int *minptr);
  157.  
  158.  
  159.  
  160. /*--------------------- radec_text -----------------------
  161.  * Description: Builds a text string giving the specified RA
  162.  *              and Dec in conventional units.
  163.  *
  164.  * Parameters:  REAL ra       -- Right Ascension in radians, in the range
  165.  *                               0 <= ra < 2 PI.
  166.  *              REAL dec      -- Declination in radians, in the range
  167.  *                               -PI/2 <= dec <= PI/2 (South negative).
  168.  *              char *textptr -- pointer to string to receive text.
  169.  *                               String must be RADEC_TEXTLEN long at least.
  170.  * Returns:     void.
  171.  * Other info:  see above for macro RADEC_TEXTLEN.
  172.  */
  173.  
  174. void radec_text(REAL ra, REAL dec, char *textptr);
  175.